home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group97a.txt / 000004_icon-group-sender _Fri Jan 3 11:52:09 1997.msg < prev    next >
Internet Message Format  |  2000-09-20  |  1KB

  1. Received: by cheltenham.cs.arizona.edu; Fri, 3 Jan 1997 17:23:42 MST
  2. Date: Fri, 3 Jan 1997 11:52:09 -0600
  3. Message-Id: <199701031752.LAA32416@ns1.computek.net>
  4. Mime-Version: 1.0
  5. Content-Type: text/plain
  6. Content-Transfer-Encoding: 7bit
  7. From: gep2@computek.net
  8. Subject: Help for an Icon Neophyte
  9. To: icon-group@cs.arizona.edu
  10. X-Mailer: SPRY Mail Version: 04.00.06.17
  11. Errors-To: icon-group-errors@cs.arizona.edu
  12. Status: RO
  13. Content-Length: 761
  14.  
  15. >procedure countwords()
  16. wordcount := table(0)
  17. while line := read() do
  18.     line ? {
  19.             while tab(upto(&letters)) do
  20.                 wordcount[tab(many(&letters))] +:= 1
  21.             }
  22. return wordcount
  23. end
  24.  
  25. >I have run into the following problems.  First, I was unsuccessful at
  26. mapping lowercase letters on to uppercase letters.  I assume that I want
  27. to use something like map(line, &ucase, &lcase), but where should I
  28. insert it?  And should the csets &ucase and &lcase be bracketted by
  29. single quotations marks?  
  30.  
  31. You can simply change the appropriate line from the countwords routine as 
  32. follows:
  33.  
  34. while line := map(read(),&ucase,&lcase) do
  35.  
  36. I expect that you'll receive lots of other replies for the other issues you 
  37. mentioned.
  38.  
  39. Gordon Peterson
  40. http://www.computek.net/public/gep2/
  41.  
  42.